package cn.edu.imnu.vacate.leave.pojo;

import java.util.Date;

import cn.edu.imnu.vacate.leave.enumes.ALeaveEnum;
import cn.edu.imnu.vacate.users.pojo.AUser;

/**
 * 请假表的实体类
 * @author MCR
 *
 */
public class ALeave
{
	private int id;
	private int uid;
	private String reason;
	private String direction;
	private String mobile;
	private String homeMobile;
	private String teacherSuggestion;
	private String xgbSuggestion;
	private byte status;
	private Date startTime;
	private Date endTime;
	private Date createTime;
	private Date teacheCheckTime;
	private Date xgbCheckTime;
	
	/*状态*/
	private String statusStr;
	
	/*关联关系*/
	private AUser user;
	
	
	public int getId()
	{
		return id;
	}
	public void setId(int id)
	{
		this.id = id;
	}
	public int getUid()
	{
		return uid;
	}
	public void setUid(int uid)
	{
		this.uid = uid;
	}
	public String getReason()
	{
		return reason;
	}
	public void setReason(String reason)
	{
		this.reason = reason;
	}
	public String getDirection()
	{
		return direction;
	}
	public void setDirection(String direction)
	{
		this.direction = direction;
	}
	public String getMobile()
	{
		return mobile;
	}
	public void setMobile(String mobile)
	{
		this.mobile = mobile;
	}
	public String getHomeMobile()
	{
		return homeMobile;
	}
	public void setHomeMobile(String homeMobile)
	{
		this.homeMobile = homeMobile;
	}
	public String getTeacherSuggestion()
	{
		return teacherSuggestion;
	}
	public void setTeacherSuggestion(String teacherSuggestion)
	{
		this.teacherSuggestion = teacherSuggestion;
	}
	public String getXgbSuggestion()
	{
		return xgbSuggestion;
	}
	public void setXgbSuggestion(String xgbSuggestion)
	{
		this.xgbSuggestion = xgbSuggestion;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Date getStartTime()
	{
		return startTime;
	}
	public void setStartTime(Date startTime)
	{
		this.startTime = startTime;
	}
	public Date getEndTime()
	{
		return endTime;
	}
	public void setEndTime(Date endTime)
	{
		this.endTime = endTime;
	}
	public Date getCreateTime()
	{
		return createTime;
	}
	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}
	public Date getTeacheCheckTime()
	{
		return teacheCheckTime;
	}
	public void setTeacheCheckTime(Date teacheCheckTime)
	{
		this.teacheCheckTime = teacheCheckTime;
	}
	public Date getXgbCheckTime()
	{
		return xgbCheckTime;
	}
	public void setXgbCheckTime(Date xgbCheckTime)
	{
		this.xgbCheckTime = xgbCheckTime;
	}
	public String getStatusStr()
	{
		/**
		 * 1 通过 0 角色 2 审核中 3 班主任通过
		 */
		ALeaveEnum[] leaveEnums = ALeaveEnum.values();
		for (int i = 0; i < leaveEnums.length; i++)
		{
			ALeaveEnum leaveEnum = leaveEnums[i];
			if(leaveEnum.toString().startsWith("STATUS"))
			{
				if(leaveEnum.getStatus() == this.status)
				{
					this.statusStr = leaveEnum.getInfo();
					break;
				}
			}
		}
		return statusStr;
	}
	public AUser getUser()
	{
		return user;
	}
	public void setUser(AUser user)
	{
		this.user = user;
	}
	
	
}
